package cn.gzsxt.music.mapper;

import java.util.Map;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Mapper;

@Mapper
public interface SsListMapper {

	@Insert("Insert into mc_sslist (songList_id,song_id,ssList_date) values (#{songList_id},#{song_id},#{ssList_date})")
	int saveSsList(Map<String, Object> m_ssList);

	@Insert("Insert into mc_sslist (songList_id,song_id,ssList_date) select #{songList_id},#{song_id},#{ssList_date} from mc_sslist where not exists(select * from mc_sslist where song_id in (#{song_id}) and songList_id in (#{songList_id})) limit 0,1")
	int insertSong(Map<String, Object> m_ssList);

	@InsertProvider(method = "insertAllSong", type = SsListProvider.class)
	int insertAllSong(Map<String, Object> m_ssList);

	@DeleteProvider(method = "deleteSong", type = SsListProvider.class)
	int deleteSong(Map<String, Object> m_ssList);

	@Delete("delete from mc_sslist where songList_id = #{songList_id}")
	int deleteAllSong(Long songList_id);

	@Delete("delete from mc_usList where songList_id = #{songList_id}")
	int deleteUserSongList(Long songList_id);

}
